﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" />
    <title>驰骋流程&表单设计器 </title>
    <script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/config.js" type="text/javascript"></script>
    <link href="../../WF/Style/skin/css/login.css" type="text/css" rel="stylesheet" />
    <script src="../../WF/Comm/Gener.js" type="text/javascript"></script>
    <script src="../../WF/Comm/JS/validation.js"></script>
    <base target="_self" />
    <style>
        .login-All {
            background: #eeeeee;
        }
        .design_list {
            margin: 5px 0;
            height: 30px;
            line-height: 30px;
            color: #551A8b;
          
        }
        fieldset {
            box-shadow: 1px 1px 6px #323232;
            border: 1px solid transparent;
            background-color: transparent;
        }
        a {
            text-decoration: none;
        }
    </style>
    <script type="text/javascript">
        var name = null;

        //初始化页面函数.....
        $(function () {
            var orgs;
            if (plant == "JFlow") {
                var httphandler = new HttpHandler("BP.Cloud.Httphandler.Portal_SaaS");
                var data = httphandler.DoMethodReturnJSON("SelectOneOrg_Init");
                if (data.indexOf('err@') == 0) {
                    alert(data);
                    return;
                }
                orgs = data;
            } else {
                var orgs = new Entities("BP.Cloud.Orgs");
                orgs.RetrieveAll();
            }

            var html = "<ul>";
            for (var i = 0; i < orgs.length; i++) {
                var en = orgs[i];
                if (en.No == 100)
                    continue;
                html += "<li class='design_list'><a href='Login.htm?OrgNo=" + en.No + "'>" + en.No + " - " + en.Name + "</a></li>";
            }
            html += "</ul>";
            $("#list").html(html);
            return;

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_CCBPMDesigner");
            var data = handler.DoMethodReturnString("SelectOneOrg_Init");
            if (data.indexOf('err@') == 0) {
                $("#list").html(data);
                return;
            }

            datas = JSON.parse(data);

            //$("#cc").html("<img src='/Admin/Portal/Img/loading_small.gif' /><font color=blue>ccbpm 正在登录请您稍后.</font>");
            var webUser = new WebUser();

            var orgNo = webUser.OrgNo;

            var html = "<ul style='align:left'>";
            for (var i = 0; i < datas.length; i++) {

                var data = datas[i];

                if (data.No == orgNo)
                    html += "<li><h2><a href=\"javascript:SelectOrg('" + data.No + "');\" >" + data.No + " " + data.Name + " </a></h2> </li>";
                else
                    html += "<li><a href=\"javascript:SelectOrg('" + data.No + "');\" >" + data.No + " " + data.Name + " </a> </li>";
            }
            html += "</ul>";
            $("#list").html(html);
        });

        function SelectOrg(no) {

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_CCBPMDesigner");
            handler.AddPara("OrgNo", no);
            var data = handler.DoMethodReturnString("SelectOneOrg_Selected");
            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }

            data = data.substring(4);
            SetHref(data);
            return;
        }
    </script>
    <script src="../../Scripts/jquery-1.11.0.min.js"></script>
</head>

    <body class="login-All">
        <form id="cc">
            <br />
            <center>
                <h3>请选择要登录的组织 -  <a href="./Admin/Login.htm">超级管理员登陆</a> - <a href="/CCMobilePortal/SaaS/SelectOneOrg.htm">移动端登陆</a></h3>
                <fieldset style="width:50%; text-align:left">
                    <div id="title">
                    </div>
                    <div id="list"></div>
                </fieldset>
            </center>
        </form>

    </body>
</html>